/*
 * @Author: WangLi
 * @Date: 2021-08-02 14:56:53
 * @LastEditors: WangLi
 * @LastEditTime: 2024-03-06 14:09:07
 * @Description:
 */
const app = getApp();
Component({
  options: {
    addGlobalClass: true,
  },
  properties: {
    title: String,
    showBack: {
      type: Boolean,
      value: true,
    },
    showHome: Boolean,
    bgColor: {
      type: String,
      value: "#01bef6",
    },
  },
  data: {
    navbarHeight: app.globalData.navbarHeight,
    statusBarHeight: app.globalData.statusBarHeight,
    titlePadding: app.globalData.titlePadding,
    rootStyle: `height:${app.globalData.navbarHeight}px;padding-top:${app.globalData.statusBarHeight}px;background-color:#01bef6`,
    wrapStyle: `padding-left:${app.globalData.titlePadding}px;padding-right:${app.globalData.titlePadding}px`,
  },
  methods: {
    onGoBack() {
      wx.navigateBack();
    },
    onGoHome() {
      wx.switchTab({
        url: "/pages/home/index",
      });
    },
  },
});
